#include <iostream>

#include "animal.h"
#include "builder.h"

using namespace std;

class AnimalDirector
{
public:
	Animal* construct(AnimalBuilder& builder)
	{
		builder.buildName();
		builder.buildWing();
		builder.buildFoot();
		builder.buildTail();

		return builder.getAnimal();
	}
};

int main()
{
	Animal* pAnimal;
	AnimalDirector director;
	CatBuilder catBuilder;
	ChickenBuilder chickenBuilder;

	pAnimal = director.construct(catBuilder);
	pAnimal->show();
	delete pAnimal, pAnimal = NULL;

	pAnimal = director.construct(chickenBuilder);
	pAnimal->show();
	delete pAnimal, pAnimal = NULL;

	return 0;
}